package com.itheima.da_te_bs;

import com.itheima.bean.Student;
import org.apache.ibatis.annotations.Many;
import org.apache.ibatis.annotations.Result;
import org.apache.ibatis.annotations.Results;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface StudentMappoer {
    @Select("SELECT * FROM student")
    @Results({
            @Result(column = "id",property = "id"),
            @Result(column = "name",property = "name"),
            @Result(column = "age",property = "age"),
            @Result(
                    property = "courses",
                    javaType = List.class,
                    column = "id",
            many= @Many(select = "com.itheima.da_te_bs.courseMapper.selectBysid")

            )


    })
    public abstract List<Student>selectAll();
}
